home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
PInterfaces
/
Processes.p
< prev
next >
Wrap
Text File
|
1996-05-01
|
7KB
|
254 lines
{
File: Processes.p
Contains: Process Manager Interfaces.
Version: Technology: System 7.5
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
}
{$IFC UNDEFINED UsingIncludes}
{$SETC UsingIncludes := 0}
{$ENDC}
{$IFC NOT UsingIncludes}
UNIT Processes;
INTERFACE
{$ENDC}
{$IFC UNDEFINED __PROCESSES__}
{$SETC __PROCESSES__ := 1}
{$I+}
{$SETC ProcessesIncludes := UsingIncludes}
{$SETC UsingIncludes := 1}
{$IFC UNDEFINED __TYPES__}
{$I Types.p}
{$ENDC}
{$IFC UNDEFINED __EVENTS__}
{$I Events.p}
{$ENDC}
{$IFC UNDEFINED __FILES__}
{$I Files.p}
{$ENDC}
{$IFC FOR_SYSTEM8_PREEMPTIVE }
{$IFC UNDEFINED __KERNEL__}
{$I Kernel.p}
{$ENDC}
{$IFC UNDEFINED __FILEMANAGERTYPES__}
{$I FileManagerTypes.p}
{$ENDC}
{$ENDC}
{$PUSH}
{$ALIGN MAC68K}
{$LibExport+}
{ type for unique process identifier }
TYPE
ProcessSerialNumberPtr = ^ProcessSerialNumber;
ProcessSerialNumber = RECORD
highLongOfPSN: LONGINT;
lowLongOfPSN: LONGINT;
END;
CONST
{ Process identifier - Various reserved process serial numbers }
kNoProcess = 0;
kSystemProcess = 1;
kCurrentProcess = 2;
{$IFC FOR_SYSTEM8_PREEMPTIVE }
{ supported versions for GetApplicationInformation }
kApplicationInformationVersion = 1;
TYPE
ApplicationInformationPtr = ^ApplicationInformation;
ApplicationInformation = RECORD
primaryTaskID: TaskID;
applicationLauncher: KernelProcessID;
applicationFile: FSObjectRef;
END;
FUNCTION GetApplicationInformation(theProcessID: KernelProcessID; version: PBVersion; VAR appInfo: ApplicationInformation): OSStatus; C;
CONST
{ supported versions for LaunchInformation structure }
kLaunchInformationVersion = 1;
TYPE
LaunchInformationPtr = ^LaunchInformation;
LaunchInformation = RECORD
kernelProcessID: KernelProcessID;
END;
{ for now, the launch call only supports an application in the FSObjectSpecification }
FUNCTION Launch(theFSObjectRef: FSObjectRef; version: PBVersion; VAR launchInfo: LaunchInformation): OSStatus; C;
FUNCTION GetKernelProcessIDFromPSN({CONST}VAR PSN: ProcessSerialNumber; VAR kernelProcessID: KernelProcessID): OSStatus; C;
FUNCTION GetPSNFromKernelProcessID(kernelProcessID: KernelProcessID; VAR PSN: ProcessSerialNumber): OSStatus; C;
{$ENDC}
{ Definition of the parameter block passed to _Launch }
{
Typedef and flags for launchControlFlags field
#if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED??
}
TYPE
LaunchFlags = INTEGER;
CONST
launchContinue = $4000;
launchNoFileFlags = $0800;
launchUseMinimum = $0400;
launchDontSwitch = $0200;
launchAllow24Bit = $0100;
launchInhibitDaemon = $0080;
{
Format for first AppleEvent to pass to new process. The size of the overall
buffer variable: the message body immediately follows the messageLength
}
TYPE
AppParametersPtr = ^AppParameters;
AppParameters = RECORD
theMsgEvent: EventRecord;
eventRefCon: LONGINT;
messageLength: LONGINT;
END;
{ Parameter block to _Launch }
LaunchParamBlockRecPtr = ^LaunchParamBlockRec;
LaunchParamBlockRec = RECORD
reserved1: LONGINT;
reserved2: INTEGER;
launchBlockID: INTEGER;
launchEPBLength: LONGINT;
launchFileFlags: INTEGER;
launchControlFlags: LaunchFlags;
launchAppSpec: FSSpecPtr;
launchProcessSN: ProcessSerialNumber;
launchPreferredSize: LONGINT;
launchMinimumSize: LONGINT;
launchAvailableSize: LONGINT;
launchAppParameters: AppParametersPtr;
END;
LaunchPBPtr = ^LaunchParamBlockRec;
{
Set launchBlockID to extendedBlock to specify that extensions exist.
Set launchEPBLength to extendedBlockLen for compatibility.
}
CONST
extendedBlock = $4C43; { 'LC' }
extendedBlockLen = 32;
{ Definition of the information block returned by GetProcessInformation }
modeLaunchDontSwitch = $00040000;
modeDeskAccessory = $00020000;
modeMultiLaunch = $00010000;
modeNeedSuspendResume = $00004000;
modeCanBackground = $00001000;
modeDoesActivateOnFGSwitch = $00000800;
modeOnlyBackground = $00000400;
modeGetFrontClicks = $00000200;
modeGetAppDiedMsg = $00000100;
mode32BitCompatible = $00000080;
modeHighLevelEventAware = $00000040;
modeLocalAndRemoteHLEvents = $00000020;
modeStationeryAware = $00000010;
modeUseTextEditServices = $00000008;
modeDisplayManagerAware = $00000004;
{ Record returned by GetProcessInformation }
TYPE
ProcessInfoRecPtr = ^ProcessInfoRec;
ProcessInfoRec = RECORD
processInfoLength: LONGINT;
processName: StringPtr;
processNumber: ProcessSerialNumber;
processType: LONGINT;
processSignature: OSType;
processMode: LONGINT;
processLocation: Ptr;
processSize: LONGINT;
processFreeMem: LONGINT;
processLauncher: ProcessSerialNumber;
processLaunchDate: LONGINT;
processActiveTime: LONGINT;
processAppSpec: FSSpecPtr;
END;
{ #endif // FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED?? }
{$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
FUNCTION LaunchApplication(LaunchParams: LaunchPBPtr): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $205F, $A9F2, $3E80;
{$ENDC}
FUNCTION LaunchDeskAccessory({CONST}VAR pFileSpec: FSSpec; pDAName: Str255): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $3F3C, $0036, $A88F;
{$ENDC}
FUNCTION GetCurrentProcess(VAR PSN: ProcessSerialNumber): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $3F3C, $0037, $A88F;
{$ENDC}
FUNCTION GetFrontProcess(VAR PSN: ProcessSerialNumber): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $70FF, $2F00, $3F3C, $0039, $A88F;
{$ENDC}
FUNCTION GetNextProcess(VAR PSN: ProcessSerialNumber): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $3F3C, $0038, $A88F;
{$ENDC}
FUNCTION GetProcessInformation({CONST}VAR PSN: ProcessSerialNumber; VAR info: ProcessInfoRec): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $3F3C, $003A, $A88F;
{$ENDC}
FUNCTION SetFrontProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $3F3C, $003B, $A88F;
{$ENDC}
FUNCTION WakeUpProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $3F3C, $003C, $A88F;
{$ENDC}
FUNCTION SameProcess({CONST}VAR PSN1: ProcessSerialNumber; {CONST}VAR PSN2: ProcessSerialNumber; VAR result: BOOLEAN): OSErr;
{$IFC NOT GENERATINGCFM}
INLINE $3F3C, $003D, $A88F;
{$ENDC}
{$ENDC}
{$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
{$IFC NOT OLDROUTINELOCATIONS }
PROCEDURE ExitToShell;
{$IFC NOT GENERATINGCFM}
INLINE $A9F4;
{$ENDC}
{$ENDC}
{$ENDC}
{$ALIGN RESET}
{$POP}
{$SETC UsingIncludes := ProcessesIncludes}
{$ENDC} {__PROCESSES__}
{$IFC NOT UsingIncludes}
END.
{$ENDC}